package com.jinhua.batch.model;

import com.alibaba.excel.annotation.ExcelProperty;

import java.util.Objects;

/**
 * Copyright
 *
 * @Author WuHuang
 * @Date 2023/3/31
 */
public class ResultItemVO {
    @ExcelProperty({"是否处理成功"})
    private boolean success = true;
    @ExcelProperty({"处理失败的原因"})
    private String failReason;

    public ResultItemVO() {
    }

    public boolean isSuccess() {
        return this.success;
    }

    public String getFailReason() {
        return this.failReason;
    }

    public void setSuccess(final boolean success) {
        this.success = success;
    }

    public void setFailReason(final String failReason) {
        this.failReason = failReason;
    }


    protected boolean canEqual(final Object other) {
        return other instanceof ResultItemVO;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ResultItemVO that = (ResultItemVO) o;
        return success == that.success && Objects.equals(failReason, that.failReason);
    }

    @Override
    public int hashCode() {
        return Objects.hash(success, failReason);
    }

    public String toString() {
        return "ResultItemVO(success=" + this.isSuccess() + ", failReason=" + this.getFailReason() + ")";
    }

}
